package com.czh.auth.domain.service.impl;

import com.czh.auth.domain.convert.AuthRoleDomainConverter;
import com.czh.auth.domain.entity.AuthRoleBO;
import com.czh.auth.domain.service.AuthRoleDomainService;
import com.czh.auth.infra.basic.service.AuthRoleService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;

/**
 * @author caozaihui
 * @version 1.0
 * @since 2024/8/28 下午 6:35
 */
@Service
public class AuthRoleDomainServiceImpl implements AuthRoleDomainService {


    @Resource
    private AuthRoleService authRoleService;
    @Override
    public Boolean addRole(AuthRoleBO authRoleBO) {
        return authRoleService.insert(AuthRoleDomainConverter.INSTANCE.convert(authRoleBO))>0;
    }

    @Override
    public Boolean updateRole(AuthRoleBO authRoleBO) {
        return authRoleService.update(AuthRoleDomainConverter.INSTANCE.convert(authRoleBO))>0;
    }

    @Override
    public Boolean deleteRole(Long id) {
        return authRoleService.removeById(id);
    }
}
